/*Include SunShine reserver pour le serveur SunShine Uniquement*/
/*
native SetPlayerLogin(playerid,active);
native GetPlayerLogin(playerid);
native SetPlayerLevel(playerid,level);
native GetPlayerLevel(playerid);
native BuyBizPlayer(playerid,bizid);
native GetBizPlayer(playerid);
native DeleteVarPlayer(playerid);
native CompteJoueur(playerid);
native nom(playerid);
native SendTeamMessage(Teamid,Color,text[]);
native PlayerNameStartsWith(playerid, const name[]);
native GetPlayerInDm(playerid);
native SetPlayerInDm(playerid,dmid);
native GetPlayerIsAfk(playerid);
native SetPlayerIsAfk(playerid,active);
native ERRORMSG(Text[]);
native INFOMSG(Text[]);
native OKMSG(Text[]);
*/

#include <dudb>
#include <Dini>
#pragma unused ret_memcpy
new Team[MAX_PLAYERS];

#define SetPlayerLogin(%0,%1) SetPVarInt(%0, "Login", %1)
#define SetPlayerIsAfk(%0,%1) SetPVarInt(%0, "PAFK", %1)
#define SetPlayerInDm(%0,%1) SetPVarInt(%0, "INDM", %1)
#define SetPlayerLevel(%0,%1) SetPVarInt(%0, "Admin", %1)
#define BuyBizPlayer(%0,%1) SetPVarInt(%0, "Biz", %1)

stock GetPlayerIsAfk(playerid)
{

	return GetPVarInt(playerid, "PAFK");

}

stock GetPlayerInDm(playerid)
{

	return GetPVarInt(playerid, "INDM");

}
stock GetPlayerLogin(playerid)
{

	return GetPVarInt(playerid, "Login");

}

stock GetPlayerLevel(playerid)
{

	return GetPVarInt(playerid, "Admin");

}

stock GetBizPlayer(playerid)
{

	return GetPVarInt(playerid, "Biz");

}
stock DeleteVarPlayer(playerid)
{
	DeletePVar(playerid,"Login");
	DeletePVar(playerid,"Admin");
	DeletePVar(playerid,"Biz");
}
stock CompteJoueur(playerid)
{
	new str2[MAX_PLAYER_NAME+4];
	format(str2,sizeof(str2),"%s.LZR",nom(playerid));
	return str2;
}
stock nom(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	return name;
}

stock PlayerNameStartsWith(playerid, const name[])
{
	if(IsPlayerConnected(playerid))
	{
		new PName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, PName, sizeof(PName));
		if(strfind(PName, name, true)==0)
		{
	    	return 1;
		}
	}
	else
	{
	    return 0;
	}
	return 0;
}

stock SendTeamMessage(Teamid,Color,text[])
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(Team[i] == Teamid)
		    {
		        SendClientMessage(i,Color,text);
		    }
		}
	}
}

stock Perso()
{

	AddPlayerClass(105,2482.4380,-1691.2456,13.5168,349.3774,0,0,0,0,0,0); // spawn groove1
	AddPlayerClass(106,2508.0232,-1655.6295,13.5938,127.2454,0,0,0,0,0,0); // spawn groove2
	AddPlayerClass(107,2469.4294,-1652.2251,13.4717,167.4250,0,0,0,0,0,0); // spawn groove3
	AddPlayerClass(114,2239.9795,-1315.8788,23.9844,330.5211,0,0,0,0,0,0); // spawn aztecspawn1
	AddPlayerClass(115,2201.8530,-1348.5720,25.6221,103.3523,0,0,0,0,0,0); // spawn aztecspawn2
	AddPlayerClass(116,2208.2170,-1314.8685,23.9844,3.7348,0,0,0,0,0,0); // spawn aztecspawn3
	AddPlayerClass(247,1953.4357,-1379.7373,24.1484,118.0774,0,0,0,0,0,0); // spawn biker1
	AddPlayerClass(248,1869.6365,-1363.8185,19.1406,166.6445,0,0,0,0,0,0); // spawn biker2
	AddPlayerClass(254,1913.6262,-1417.9291,16.3594,278.8189,0,0,0,0,0,0); // spawn biker3
	AddPlayerClass(62,1140.2744,-1770.4419,16.5992,283.1529,0,0,0,0,0,0); // spawn civil1
	AddPlayerClass(66,1209.8649,-1748.2490,13.5937,354.5937,0,0,0,0,0,0); // spawn civil2
	AddPlayerClass(67,1214.3502,-1814.9650,16.5938,80.4477,0,0,0,0,0,0); // spawn civil3
	AddPlayerClass(265,1551.0134,-1675.1929,15.6594,90.8509,0,0,0,0,0,0); // spawn police1
	AddPlayerClass(266,1579.1594,-1634.2012,13.5624,156.9648,0,0,0,0,0,0); // spawn police2
	AddPlayerClass(267,1531.7312,-1677.0187,5.8906,230.2621,0,0,0,0,0,0); // spawn police3
	AddPlayerClass(167,957.3268,-1359.9036,13.3502,194.2926,0,0,0,0,0,0); // spawn chiken1
	AddPlayerClass(155,925.2712,-1351.8301,13.3759,10.6775,0,0,0,0,0,0); // spawn chiken2
	AddPlayerClass(209,934.7540,-1334.8933,13.5469,248.4763,0,0,0,0,0,0); // spawn chiken3
	AddPlayerClass(111,440.4930,-1746.7375,9.0374,207.7970,0,0,0,0,0,0); // spawn mafia1
	AddPlayerClass(112,422.5658,-1761.9390,10.5358,198.0836,0,0,0,0,0,0); // spawn mafia2
	AddPlayerClass(113,383.3552,-1748.5078,8.7382,10.0818,0,0,0,0,0,0); // spawn mafia3
}









#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_LIGHTBLUE "{33CCFF}"
#define COL_EASY "{FFF1AF}"
#define COL_BLACK "{0E0101}"
#define COL_GREY "{C3C3C3}"
#define COL_GREEN "{9EC73D}"
#define COL_YELLOW "{F3FF02}"
#define COL_ORANGE "{FFAF00}"
#define COL_LIME "{B7FF00}"
#define COL_CYAN "{00FFEE}"
#define COL_BLUE "{2641FE}"
#define COL_MAGENTA "{F300FF}"
#define COL_VIOLET "{B700FF}"
#define COL_PINK "{FF00EA}"
#define COL_MARONE "{A90202}"
#define COL_CMD "{B8FF02}"
#define COL_PARAM "{3FCD02}"
#define COL_SERVER "{AFE7FF}"
#define COL_VALUE "{A3E4FF}"
#define COL_RULE "{F9E8B7}"
#define COL_RULE2 "{FBDF89}"
#define COL_LGREEN "{C9FFAB}"
#define COL_LRED "{FFA1A1}"
#define COL_LRED2 "{C77D87}" 





#define ERRORMSG(%0) SendClientMessage(playerid,0xFF0000FF,%0)
#define OKMSG(%0) SendClientMessage(playerid,0x00FF33AA,%0)
#define INFOMSG(%0) SendClientMessage(playerid,0xFFFF00AA,%0)
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0)\
&& (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_CARDIVE 0xEE82EEAA
#define COLOR_BLACK_PD 0x000000FF
#define COLOR_WHITE_PD 0xFFFFFFFF
#define COLOR_DISARMING 0xEE82EEBB
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_IVORY 0xFFFF82FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_PURPLE 0x800080FF
#define COLOR_RED 0xFF0000FF
#define COLOR_LIGHTGREEN 0x00FF7FFF
#define COLOR_VIOLET 0xEE82EEFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_SILVER 0xC0C0C0FF
#define COLOR_LIGHTBLUE 0x87CEFAFF
#define COLOR_PINK 0xFFB6C1FF
#define COLOR_INDIGO 0x4B00B0FF
#define COLOR_GOLD 0xFFD700FF
#define COLOR_FIREBRICK 0xB22222FF
#define COLOR_LIGHTYELLOW 0xFAFA02FF
#define COLOR_GREY 0x778899FF
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_BRIGHTGREEN 0x7CFC00FF
#define COLOR_DARKBLUE 0x000080AFF
#define COLOR_VIOLETRED 0xDB7093FF
#define COLOR_BROWN 0x8B4513FF
#define COLOR_GREENYELLOW 0xADFF2FFF
#define COLOR_THISTLE 0xD8BFD8FF
#define COLOR_TURQUISE 0x48D1CCFF
#define COLOR_MAROON 0x800000FF
#define COLOR_STEELBLUE 0xB0C4DEFF
#define cyan 0x00FFFFAA
#define green 0x33FF33AA
#define red 0xFF0000AA
#define yellow 0xFFFF00AA
#define COLOR_KEKSE 0xFF69B4AA
#define COLOR_PLAYER_VIOLET 0xEE82EEFF
#define COLOR_PLAYER_GREENYELLOW 0xADFF2FFF
#define COLOR_PLAYER_LIGHTBLUE 0x9292FFDD
#define COLOR_PLAYER_BLUE 0x0000FFDD
#define COLOR_PLAYER_DARKBLUE 0x000096DD
#define COLOR_PLAYER_SPECIALBLUE 0x4169FFDD
#define COLOR_PLAYER_LIGHTRED 0xFFB0B0DD
#define COLOR_PLAYER_RED 0xFF0000DD
#define COLOR_PLAYER_DARKRED 0xA10000DD
#define COLOR_PLAYER_SPECIALRED 0xB22222DD
#define COLOR_PLAYER_LIGHTGREEN 0x92FF92DD
#define COLOR_PLAYER_GREEN 0x00FF00DD
#define COLOR_PLAYER_DARKGREEN 0x009600DD
#define COLOR_PLAYER_SPECIALGREEN 0x7ACA7ADD
#define COLOR_PLAYER_LIGHTYELLOW 0xFFFF5EDD
#define COLOR_PLAYER_YELLOW 0xFFFF00DD
#define COLOR_PLAYER_DARKYELLOW 0xD3D300DD
#define COLOR_PLAYER_SPECIALYELLOW 0xCFAE00DD
#define COLOR_PLAYER_LIGHTPURPLE 0xFF92FFDD
#define COLOR_PLAYER_PURPLE 0xFF00FFDD
#define COLOR_PLAYER_DARKPURPLE 0x800080DD
#define COLOR_PLAYER_SPECIALPURPLE 0xDA70D6DD
#define COLOR_PLAYER_LIGHTBROWN 0xBA9072DD
#define COLOR_PLAYER_BROWN 0x8B4513DD
#define COLOR_PLAYER_DARKBROWN 0x6D360EDD
#define COLOR_PLAYER_LIGHTGREY 0xC7C7C7DD
#define COLOR_PLAYER_GREY 0x8B8B8BDD
#define COLOR_PLAYER_DARKGREY 0x656565DD
#define COLOR_PLAYER_WHITE 0xFFFFFFDD
#define COLOR_PLAYER_BLACK 0x000000DD
#define COLOR_PLAYER_AQUAMARINE 0x7FFFD4DD
#define COLOR_PLAYER_CYAN 0x00FFFFDD
#define COLOR_PLAYER_KEKSE 0xFF69B4AA
#define COLOR_TRANS 0x00000000
#define COLOR_TRANS_BLUE 0x00FF7F80
#define COLOR_TRANS_RED 0xFF000000
#define COLOR_GANG_BLUE 0x0000FF80
#define COLOR_GANG_RED 0xFF000080
#define COLOR_GANG_LIGHTGREEN 0x00FF7F80
#define COLOR_TEAM1 0x009600DD
#define COLOR_TEAM2 0x87CEFAFF
#define COLOR_TRANS_TEAM1 0x00960000
#define COLOR_TRANS_TEAM2 0x87CEFA00
#define COLOR_TC 0xFF2F2FFF
#define COLOR_SYSTEM 0xF5FF9FAA
#define COLOR_ADMINISTRATOR 0xa0d3ffAA